{extend name="base" /} {block name="body"}
<div class="right">
	<!--右侧内容-->
	<div class="rigtop zizh_rtop">
		<span class="title">余额记录</span>
	</div>
	<div class="indrig_con">
		<div class="zizh_conbox" style="padding-top: 20px;">
			<!--选项卡内容开始-->
			<div class="zizh_con_1">
				<form id="my_form" action="{:url('finace/money')}" method="post">
				<div class="shxx_row chax_row clearfix">
					<div class="left">时间：</div>
					<div class="right clearfix">
						<input type="text" name="begin_time" value="{$begin_time}" placeholder="开始时间" id="begin_time" class="chax_input" />
						<i class="chax_line"></i>
						<input type="text" name="end_time" value="{$end_time}" placeholder="结束时间" id="end_time" class="chax_input" />
					</div>
					<div class="right clearfix">
						<button type="submit" onclick="return check_time()" class="htcxbtn">查询</button>
					</div>
				</div>
				</form>
				<div class="chax_conbox" style="margin-top: 0px;">
					<div class="chax_jiegnr">
						<table class="zizh_table1 zizh_table2">
							<thead>
								<tr>
									<th>创建时间</th>
									<th>来源</th>
									<th>金额</th>
								</tr>
							</thead>
							<tbody id="tbody">
								{volist name="list" id="vo" empty="$empty"}
								<tr>
									<td>{$vo.add_time|default='0'}</td>
									<td>
										{switch name="$vo.order_type"} {case value="1"}订单{/case} {case value="2"}订单退款{/case} {case value="3"}扫码支付{/case} {case value="4"}扫码退款{/case} {case value="5"}提现{/case} {default /}提现失败 {/switch}
									</td>
									<td>{$vo.balance|default='0'}</td>
								</tr>
								{/volist}
							</tbody>
						</table>
						<div class="fenye" style="display: block;">
							<ul class="pagination">
								{$list->render()}
							</ul>
						</div>
					</div>
				</div>
			</div>

		</div>

	</div>
</div>

{/block}
{block name="script"}
<link rel="stylesheet" href="__PUBLIC__/static/layui/css/layui.css">
<script>
	layui.use('laydate', function() {
		var laydate = layui.laydate;

		//日期控件
		laydate.render({
			elem: '#begin_time',
			type: 'datetime',
			format: 'yyyy-MM-dd HH:mm:ss'
		});

		laydate.render({
			elem: '#end_time',
			type: 'datetime',
			format: 'yyyy-MM-dd HH:mm:ss'
		});
	})
	//时间区间
	function check_time() {
		var begin_time = $('#begin_time').val();
		var end_time = $('#end_time').val();
		if(begin_time.length > 2 || end_time.length > 2) {

			if(begin_time.length < 2 || end_time.length < 2) {
				layer.msg("请输入查询时间区间");
				return false;
			}

		}
	}
</script>
{/block}